package com.dgut.sales.service;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.dgut.sales.bean.Goods;
import com.dgut.sales.dao.GoodsDao;
import com.dgut.sales.dynamic.sql.bean.GoodsSearch;

@Service
public class GoodsService {

	@Autowired 
	private GoodsDao dao;
	
	public Goods getGoodsById(Integer id) {
		return dao.getGoodsById(id);
	}
	
	public List<Goods> getAllGoods(){
		return dao.getAllGoods();
	}
	
	public void updateGoods(Goods goods) {
		dao.updateGoods(goods);
	}
	
	public void addGoods(Goods goods) {
		dao.addGoods(goods);
	}
	public void deleteGoods(Integer id) {
		dao.deleteGoods(id);
	}
	public List<Goods> search(GoodsSearch goodsSearch) {
		return dao.search(goodsSearch);
	}
	public List<Map<String, Object>> searchGoodsWithMoney(){
		return dao.SearchGoodsWithMoney();
	}
}
